package com.guoxin.part1.chapter6;

/**
 * create threadGroup
 *
 * @author guoxin
 * @date 2019/8/28
 */
public class TreadGroupCreator {
    public static void main(String[] args) {
        // 获取当前线程的 group
        ThreadGroup currentGropu = Thread.currentThread().getThreadGroup();
        // 定义一个新的 group
        ThreadGroup group1 = new ThreadGroup("Group1");

        System.out.println(group1.getParent() == currentGropu);

        ThreadGroup group2 = new ThreadGroup(group1, "Group2");

        System.out.println(group2.getParent() == group1);
    }
}
